//
//  SetTest.m
//  MacTestProject
//
//  Created by LiuLichen on 2022/4/14.
//

#import "SetTest.h"

@implementation SetTest

- (id) init {
    self = [super init];

    [self test1];

    return self;
}

- (void) test1 {
    NSMutableSet* set = [NSMutableSet new];
    NSMutableArray* arrA = [@[@1, @2]mutableCopy];
    [set addObject: arrA];
    NSLog(@"set = %@", set);                    // set = {((1,2))}
    NSMutableArray* arrB = [@[@1, @2]mutableCopy];
    [set addObject: arrB];
    NSLog(@"set = %@", set);                    // set = {((1,2))}
    NSMutableArray* arrC = [@[@1]mutableCopy];
    [set addObject: arrC];
    NSLog(@"set = %@", set);                    // set = {((1),(1,2))}
    [arrC addObject: @2];
    NSLog(@"set = %@", set);                    // set = {((1,2),(1,2))}
    NSSet* setB = [set copy];
    NSLog(@"setB = %@", setB);                  // set = {((1,2))}
}

@end
